Skip to content

Persist TGT and ST obtained during kerberosLogin#2193

Open
azoxlpf wants to merge 1 commit into
fortra:masterfrom
azoxlpf:feat/kerberos-login-expose-st
Open

Persist TGT and ST obtained during kerberosLogin#2193
azoxlpf wants to merge 1 commit into
fortra:masterfrom
azoxlpf:feat/kerberos-login-expose-st

Conversation

@azoxlpf
Copy link
Copy Markdown
Contributor

@azoxlpf azoxlpf commented May 22, 2026

Following the discussion on NetExec #1239 with @NeffIsBack, this PR persists the TGT and ST that kerberosLogin / kerberos_login already obtain internally (getKerberosTGT / getKerberosTGS) into self.__TGT and self.__TGS, instead of discarding them after building the SMB AP_REQ. Callers can then retrieve those tickets via the existing getCredentials() API after a successful Kerberos login (e.g. to write a ccache with NetExec’s --generate-st / --generate-tgt without running a second KDC exchange). Changes apply to both smb.py (SMB1) and smb3.py (SMB2/3).

@laxa
Copy link
Copy Markdown
Contributor

laxa commented May 23, 2026

What about also writing them to the CCache if specified? (see #2121 )

@azoxlpf
Copy link
Copy Markdown
Contributor Author

azoxlpf commented May 29, 2026

For this PR I’d keep it minimal: persist TGT/ST and expose them via getCredentials(), without writing to disk from the library. Callers (e.g. NetExec) can then build a ccache if they want, without a second KDC exchange.

Automatic ccache writes feel like a separate, opt-in change (e.g. when KRB5CCNAME is set), better suited to #2121. That’s how I see it anyway, thoughts, guys?

@anadrianmanrique anadrianmanrique added bug Unexpected problem or unintended behavior enhancement Implemented features can be improved or revised labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected problem or unintended behavior enhancement Implemented features can be improved or revised

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants